<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link href='../packages/core/dist/main.css' rel='stylesheet' />
<link href='../packages-premium/timeline/dist/main.css' rel='stylesheet' />
<script src='../packages/core/dist/main.js'></script>
<script src='../packages/interaction/dist/main.js'></script>
<script src='../packages/google-calendar/dist/main.js'></script>
<script src='../packages-premium/timeline/dist/main.js'></script>
<script>

  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: [ 'interaction', 'timeline', 'googleCalendar' ],
      now: '2019-08-07',
      editable: true, // enable draggable events
      aspectRatio: 1.8,
      scrollTime: '00:00', // undo default 6am scrollTime
      header: {
        left: 'today prev,next',
        center: 'title',
        right: 'timelineMonth,timelineYear'
      },
      defaultView: 'timelineMonth',

      /*
      NOTE: unfortunately, Scheduler doesn't know how to associated events from
      Google Calendar with resources, so if you specify a resource list,
      nothing will show up :(  Working on some solutions.
      */

      // THIS KEY WON'T WORK IN PRODUCTION!!!
      // To make your own Google API key, follow the directions here:
      // http://fullcalendar.io/docs/google_calendar/
      googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE',

      // US Holidays
      events: 'usa__en@holiday.calendar.google.com',

      eventClick: function(arg) {
        // opens events in a popup window
        window.open(arg.event.url, 'gcalevent', 'width=700,height=600');

        // prevent browser from visiting event's URL in the current tab
        arg.jsEvent.preventDefault();
      }
    });

    calendar.render();
  });

</script>
<style>

  body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
    font-size: 14px;
  }

  #calendar {
    max-width: 900px;
    margin: 50px auto;
  }

</style>
</head>
<body>

  <div id='calendar'></div>

</body>
</html>
